import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import Home from '../views/home.vue';

const routes: RouteRecordRaw[] = [
    {
        path: '/',
        redirect: '/userManage',
    },
    {
        path: '/',
        name: 'Home',
        component: Home,
        children: [
            {
                path: '/userManage',
                name: 'userManage',
                meta: {
                    title: '用户管理'
                },
                component: () => import(/* webpackChunkName: "dashboard" */ '../views/BasicPage/UserManage.vue'),
            },
            {
                path: '/lendHandle',
                name: 'lendHandle',
                meta: {
                    title: '借用申请'
                },
                component: () => import(/* webpackChunkName: "table" */ '../views/BasicPage/lendHandle.vue'),
            },
            {
                path: '/returnHandle',
                name: 'returnHandle',
                meta: {
                    title: '归还申请'
                },
                component: () => import(/* webpackChunkName: "charts" */ '../views/BasicPage/returnHandle.vue'),
            },
            {
                path: '/brInfo',
                name: 'brInfo',
                meta: {
                    title: '借还记录'
                },
                component: () => import(/* webpackChunkName: "form" */ '../views/BasicPage/brInfo.vue'),
            },
            {
                path: '/DeviceUpdate',
                name: 'DeviceUpdate',
                meta: {
                    title: '实验室物资管理'
                },
                component: () => import(/* webpackChunkName: "tabs" */ '../views/BasicPage/DeviceUpdate.vue'),
            }
        ],
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;